<template>
  <div class="right">
    <h2>Right组件</h2>
    <p>接收到的name是：{{ name }}</p>
    <p>接收到的age是：{{ age }}</p>
    <button @click="getVal">接收</button>
    <Article></Article>
  </div>
</template>

<script>
import bus from './bus.js'
export default {
  data() {
    return {
      name: '',
      age: 0
    }
  },
  methods: {
    getVal() {
      bus.$on('share', (name, age) => {
        this.name = name
        this.age = age
      })
    }
  }
}
</script>

<style lang="less" scoped>
.right {
  background-color: indianred;
}
</style>
